package org.suren.littlebird.preferences;

import org.eclipse.jface.preference.*;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.IWorkbench;
import org.suren.littlebird.Activator;

/**
 * @author suren
 * @since 2015-2-2
 */
public class SuRenPreferencePage
	extends FieldEditorPreferencePage
	implements IWorkbenchPreferencePage
{

	public SuRenPreferencePage()
	{
		super(GRID);
		setPreferenceStore(Activator.getDefault().getPreferenceStore());
		setDescription("Little preference page implementation");
	}

	/**
	 * Creates the field editors. Field editors are abstractions of
	 * the common GUI blocks needed to manipulate various types
	 * of preferences. Each field editor knows how to save and
	 * restore itself.
	 */
	public void createFieldEditors()
	{
		Composite parent = getFieldEditorParent();

		addField(new StringFieldEditor(PreferenceConstants.P_OSGI_SERVER, "Osgi &Server : ", parent));
		addField(new IntegerFieldEditor(PreferenceConstants.P_OSGI_PORT, "Osgi &Port : ", parent));
		addField(new StringFieldEditor(PreferenceConstants.P_OSGI_FILTER, "Filter : ", parent));

		addField(new StringFieldEditor(PreferenceConstants.P_BUNDLE_DIR, "Bundle Dir : ", parent));
		addField(new StringFieldEditor(PreferenceConstants.P_BUNDLE_WEB_RUNDIR, "WebRuntime : ", parent));

		addField(new IntegerFieldEditor(PreferenceConstants.P_SSH_PORT, "Ssh Port : ", parent));
		addField(new StringFieldEditor(PreferenceConstants.P_SSH_USER, "Ssh User : ", parent));
		addField(new StringFieldEditor(PreferenceConstants.P_SSH_PASSWD, "Ssh Password : ", parent));
	}

	public void init(IWorkbench workbench)
	{
	}

}